local PlayerMeta = FindMetaTable("Player")
local EntityMeta = FindMetaTable("Entity")

local function AddEXP( player, skill ) -- todo:change getnwint to some other function
	player:SetNWInt(skill.."EXP", player:GetNWInt(skill.."EXP")+5) -- todo: change value of exp as level goes up
end

function PlayerMeta:DoWork( workType )
	umsg.Start("ks_startWork", self)
		umsg.String(workType) -- type
		umsg.Short(ks_WorkTypes[workType]) -- duration
	umsg.End()
	timer.Adjust(self:SteamID().."_workTimer", ks_WorkTypes[workType], 0, AddEXP, self, workType) -- todo: adjust length of work
	timer.Start(self:SteamID().."_workTimer")
end

function PlayerMeta:StopWork()
	if (timer.IsTimer(self:SteamID().."_workTimer")) then
		timer.Stop(self:SteamID().."_workTimer")
		umsg.Start("ks_stopWork", self)
		umsg.End()
	end
end

